fix up character set of description when writing.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 5 Feb 2004 01:16:42 +0000 (01:16 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 5 Feb 2004 01:16:42 +0000 (01:16 +0000)
gpsbabel/cetus.c

index feb1abbfe81fb2fee85215929dbc685e2be0bfb0..f8373521a8933c99b60e929f1ec4b0d240bee7bd 100644 (file)
@@ -218,6 +218,7 @@ cetus_writewpt(const waypoint *wpt)
        char *vdata;
        char *desc_long;
        char *desc_short;
+       char *desc;
 
        rec = xcalloc(sizeof(*rec)+18 + NOTESZ + DESCSZ,1);
 
@@ -290,11 +291,16 @@ cetus_writewpt(const waypoint *wpt)
        } else {
                desc_long = xstrdup("");
        }
+
+       desc = wpt->description ? str_utf8_to_cp1252(wpt->description) : 
+               xstrdup("");
+
        snprintf(vdata, DESCSZ, "%s%s%s", 
-               wpt->description ? wpt->description : NULL,
+               desc,
                desc_short,
                desc_long);
 
+       xfree(desc);
        xfree(desc_short);
        xfree(desc_long);